import turtle
turtle.setup(650, 350, 200, 200)
turtle.penup()
turtle.fd(-760)
turtle.pendown()
turtle.pensize(25)
turtle.pencolor("purple")
turtle.seth(-40)
turtle.circle(40, 80/2)
turtle.speed(5)
for i in range(6):
    turtle.fd(1435)
    turtle.circle(16, 180)
    turtle.fd(2155 * 2/3)
    turtle.circle(-16, 180)
turtle.fd(1465)
turtle.circle(-16, 90)
turtle.fd(720)
turtle.circle(-16, 90)
turtle.fd(1465)
turtle.circle(-16, 180)
for i in range(5):
    turtle.fd(1435)
    turtle.circle(16, 180)
    turtle.fd(2155 * 2/3)
    turtle.circle(-16, 180)


turtle.done()
import turtle
# rose_data为存储数据的py文件
import rose_data


def draw_line(pix_list):
    '''依据pix_list的像素点数据画图'''
    turtle.penup()
    turtle.goto(*pix_list[0])
    turtle.pendown()
    for pix in pix_list:
        turtle.goto(*pix)


def draw_pic(pic_data):
    '''pic_data为字典，每个item储存每一笔的像素点数据'''
    for i in range(1, len(pic_data) + 1):
        pix_list = pic_data[i]
        draw_line(pix_list)


def init():
    turtle.title('rose')
    turtle.pensize(2)
    turtle.hideturtle()
    turtle.color('red', 'red')
    turtle.setup(width=800, height=500, startx=0, starty=0)


if __name__ == '__main__':
    init()
    draw_pic(rose_data.data)
    turtle.mainloop()